<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var arr=[];
    arr['a']=1;
    console.log(arr.length);
    console.log(arr);
    for(var i of arr){
        console.log(i);
    }
    for(var i in arr){
        console.log(i,arr[i]);
    }
    arr['2']=2;
    console.log(arr.length);
    arr.length=0;
    console.log(arr);
    function s(m){
        switch (m){
            case 'A':
                console.log('A');
                break;
            case'string':
                console.log('B');
                break;
            case undefined:
                console.log('C');
                break;
            case 'undefined':
                console.log('D');
                break;
            default:
                console.log(m);
        }
    }
    //s(new String('A'));
    var a=new String('A');
    console.log(a);
</script>
</body>
</html>